<template>
  <div class="context" v-show="isshow">
    <span class="tip">{{ text }}</span>
  </div>
</template>

<script>
export default {
  name: "Toast",
  props: {
    isshow: {
      type: Boolean,
    },
    text: {
      type: String,
    },
  },
  watch: {
    isshow(val) {
      if (val === true) {
        setTimeout(() => {
          this.isshow = false;
        }, 1500);
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.context {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  .tip {
    background-color: #3D3D3DE8;
    color: #ffffff;
    font-size: 18px;
    font-weight: 400;
    padding: 20px;
    border-radius: 5px;
    font-family: PingFang SC;
    box-shadow: 0 0 10px #3D3D3DE8;
  }
}
</style>
